package domain;

import java.io.Serializable;
/**
 * 1.该类和数据中的表对应(类名和表名可以不同,一般我们设置为相同)
 * 2.该类的属性和表的字段对应(属性和字段名字可以不同,一般我们会设置为相同)
 * 3.该类获取属性时是执行get或set方法而不是访问成员变量
 * 	 比如：获取属性user.usercode,实际上是执行user.getUsercode()方法
 * 		设置属性user.usercode="cqyhm",实际上是执行方法 user.setUsercode("cqyhm")
 * 		属性的名称是get方法去掉前面的get，同时把后面部分第一个字母改为小写。
 * @author cqyhm
 *
 */
public class User implements Serializable{

	private static final long serialVersionUID = -3162450473233964402L;
	
	private Long id;
	//用户账号
	private String usercode;
	//用户名称
	private String username;
	private String email;
	private Integer usertype;
	
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	//用户密码
	private String password;  //
	//用户类型
	
	private String oldPassword; //旧密码
	private String newPassword; //新密码
	private String rePassword;  //重新输入的密码
	
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getUsercode() {
		return usercode;
	}
	public void setUsercode(String usercode) {
		this.usercode = usercode;
	}
	
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public Integer getUsertype() {
		return usertype;
	}
	public void setUsertype(Integer usertype) {
		this.usertype = usertype;
	}
	public String getOldPassword() {
		return oldPassword;
	}
	public void setOldPassword(String oldPassword) {
		this.oldPassword = oldPassword;
	}
	public String getNewPassword() {
		return newPassword;
	}
	public void setNewPassword(String newPassword) {
		this.newPassword = newPassword;
	}
	public String getRePassword() {
		return rePassword;
	}
	public void setRePassword(String rePassword) {
		this.rePassword = rePassword;
	}
	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("User [id=");
		builder.append(id);
		builder.append(", usercode=");
		builder.append(usercode);
		builder.append(", password=");
		builder.append(password);
		builder.append(", usertype=");
		builder.append(usertype);
		builder.append("]");
		return builder.toString();
	}
	public User() {
	}
	public User(Long id, String usercode, String password, Integer usertype) {
		super();
		this.id = id;
		this.usercode = usercode;
		this.password = password;
		this.usertype = usertype;
	}
}
